package cn.edu.cqupt.educationfoundation.votingsystem.controller;

import cn.edu.cqupt.educationfoundation.votingsystem.common.response.Response;
import cn.edu.cqupt.educationfoundation.votingsystem.common.response.ResponseEntity;
import cn.edu.cqupt.educationfoundation.votingsystem.common.response.ResponseStatu;
import cn.edu.cqupt.educationfoundation.votingsystem.model.dto.*;
import cn.edu.cqupt.educationfoundation.votingsystem.model.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author :DengSiYuan
 * @date :2019/10/26 20:29
 * @desc :
 */
@Slf4j
@Api(tags = "投票模块")
@RestController
@RequestMapping("voteSystem")
public class VoteController {

    @ApiOperation("用户登录")
    @ApiImplicitParam(name = "code",value = "登录code",dataType = "string",required = true)
    @PostMapping("login")
    public ResponseEntity<UserVo> userLogin(String code, @RequestBody UserDto userDto){
        log.info("用户登陆code：{} + 信息->{}",code,userDto);
        //UserVo userVo = userService.userLogin(code,userDto);
        return new ResponseEntity<>(ResponseStatu.SUCCESS, Response.SUCCESSFUL,null);
    }

    @ApiOperation("查询所有活动")
    @GetMapping("allActivities")
    public ResponseEntity<List<ActivityVo>> allActivities(){
        return new ResponseEntity<>(ResponseStatu.SUCCESS, Response.SUCCESSFUL,null);
    }

/*    @ApiOperation("获取活动海报")
    @GetMapping("getImages")
    @ApiImplicitParam(name = "activityId",value = "活动id",dataType = "int")
    public ResponseEntity<List<ActivityImagesVo>> getImages(Integer activityId){
        return new ResponseEntity<>(ResponseStatu.SUCCESS, Response.SUCCESSFUL,null);
    }*/

/*    @ApiOperation("获取活动投票项")
    @GetMapping("getVotes")
    @ApiImplicitParam(name = "activityId",value = "活动id",dataType = "int")
    public ResponseEntity<List<VoteOptionVo>> getVotes(Integer activityId){
        return new ResponseEntity<>(ResponseStatu.SUCCESS, Response.SUCCESSFUL,null);
    }*/

/*    @ApiOperation("获取投票项文件")
    @GetMapping("getVoteFiles")
    @ApiImplicitParam(name = "voteOptionId",value = "投票选项id",dataType = "int")
    public ResponseEntity<List<VoteFileVo>> getVoteFiles(Integer voteOptionId){
        return new ResponseEntity<>(ResponseStatu.SUCCESS, Response.SUCCESSFUL,null);
    }*/

    @ApiOperation("投票")
    @PostMapping("vote")
    public ResponseEntity<VoteVo> vote(@RequestBody VoteDto voteDto){
        return new ResponseEntity<>(ResponseStatu.SUCCESS, Response.SUCCESSFUL,null);
    }
}
